<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>充值中心</title>
<link rel="stylesheet" href="${base}/static/media/css/bootstrap.css" />
<script src="${base}/static/index/vendor/jquery/jquery.min.js"></script>
<script src="${base}/static/index/vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8"
	src="${base }/static/vendor/bootstrapPager/bootstrapPager.js"></script>
<script type="text/javascript" charset="utf-8"
	src="${base }/static/js/My97DatePicker/WdatePicker.js"></script>

<link href="${base }/static/css/base.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${base }/static/css/help.css" />
<script type="text/javascript"
	src="${base }/static/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
    $(".fwmc_xxk li").click(function(){
		$(this).addClass("on").siblings().removeClass("on");
			//tola();
			//alert($(this).children("i").html());
			//$("input[name=prices]").val()
			var price = $(this).children("i").html();
			$("input[name=prices]").val(price);
		});
	/* //加
	$(".jia").click(function(){
		var fw_numb = $(".srkk").val();	
		fw_numb++;
		$(".srkk").val(fw_numb);		
		})
	//减
	$(".jian").click(function(){
		var fw_numb = $(".srkk").val();	
		if(fw_numb <= 1){
			alert("数量不足了，请住手！")
			}else{
		fw_numb--;
		$(".srkk").val(fw_numb);		
			}
		tola();
		})	 */
});

function tola(){
		var $li = $(".fwmc_xxk").children("li.on");
		var money = $li.children("i").text();
		var count = $(".srkk").val();
		
		alert(count);
		$(".zwfb_zje span").text(money*count);
		
}

function sumbits(){
		var newString = $("#test_new_line").val().replace(/\n/g, ',').replace(/\r/g, ',');
		
	 	newString = newString.replace(/_#_@/g, '<br/>');//IE7-8
	    newString = newString.replace(/_@/g, '<br/>');//IE9、FF、chrome
	    newString = newString.replace(/\s/g, '&nbsp;');//空格处理
	    //alert(newString);
		$("input[name=cards]").val(newString); 
		
		var card_type=$("input[name=card_type]:checked").val();
		var cards = $("input[name=cards]").val();
		var prices = $("input[name=prices]").val();
		
		//alert(card_type+";"+cards+";"+prices);
		if(card_type == ""){
			return false;
		}
		if(cards == ""){
			return false;
		}
		if(prices == ""){
			return false;
		}
		
		return true;
}
</script>
</head>
<body>
	<div class="portlet-body">
		<form class="dataform" id="orderlist_form"
			action="/admin/commercialTop" method="post" onsubmit="return sumbits()">
			<div class="row" style="margin-left: 110px">
				<table>
			        <tr>
			            <td>
			            	<label>卡类型：</label>
			                <label><input type="radio" name="card_type" value="cnpc"/>中石油</label>
			                <label><input type="radio" name="card_type"  checked="checked" value="sinopec"/>中石化</label>
			            </td>
			        </tr>
    			</table>
			</div>
			<div class="row">
				<label
					style="margin-left: 3%; width: 5%; height: 30px; text-align: right; display: inline-block;">油卡号：</label>
				<div style="width: 14%; height: 30px; display: inline-block;">
					<textarea name="" id="test_new_line" cols="95" rows="10">
					
					</textarea>
					<input type="hidden" name="cards" />
				</div>
			</div>
			<div class="row">
				<div
					style="width: 14%; height: 30px; display: inline-block; margin-left: 110px;">
					<td><ul class="fwmc_xxk">
						<li class="on" name="price" value="1000">
								<p>金额</p> <i>1000</i>元
							</li>
							<li name="price" value="500">
								<p>金额</p> <i>500</i>元
							</li>
							<li name="price" value="200">
								<p>金额</p> <i>200</i>元
							</li>
						</ul>
					<input type="hidden" name="prices" value="1000"/>
					</td>
				</div>

			</div>
			<div class="row">
				<div
					style="width: 14%; height: 30px; display: inline-block; margin-left: 8%; margin-top: 30px">
					<input type="submit" id="submit" class="btn offline_serch_hide"
						style="margin-right: 30px; background: #18BC9C; color: #fff; border-color: #18BC9C;"
						value="充值">
				</div>
			</div>
			<div style="width: 100%; height: 15px;"></div>
		</form>
	</div>
</body>
</html>